<template>
	<div>
		我是头部,{{value}}
    <button @click="addAge">添加</button>
    <button @click="getFatherFun">我去调用父组件中的函数</button>
    <h1>{{num}}</h1>
	</div>
</template>

<script>
	export default{
    name:"title1",
    props:["value"],
		data(){
			return{
        age:[],
        num:0
			}
		},
		components:{

		},
		methods:{
      addAge(){
        this.age.push(20)
      },
      getAge(){
        return this.age
      },
      getFatherFun(){
        this.$emit("getFatherData","我给父组件传参了");
      },
      addNum(){
        this.num++
      },

		}
	}
</script>

<style>
</style>
